package pl.szpadel.android.gadu.packets;

import java.nio.BufferOverflowException;
import java.nio.ByteBuffer;

import pl.szpadel.android.gadu.Status;

public class NewStatus80 extends SendPacket {

	private Status mStatus;
	
	public NewStatus80(Status status) {
		super(TYPE_NEW_STATUS80);
		
		mStatus = status;
	}

	@Override
	protected void writeToBuffer(ByteBuffer buffer)
			throws BufferOverflowException {

		buffer.putInt(mStatus.getGGStatus());
		buffer.putInt(0x00100000 | 0x00800000); // mobile client, accept links
		
		putString(buffer, mStatus.getDescription());
	}
	
	@Override
	public String toString() {
		return "NewStatus90: [ status=" + mStatus + " ]";
	}

}
